<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>n*n 启动</title>
    </head>
    <body>
        <input  id="乘法表" type="text" name="n*n乘法表" value="" >
        <button id="bt">启动</button>
        <script>
           
            document.getElementById('bt').onclick = function(){
                var n = parseInt(document.getElementById('乘法表').value);
                    for(a=1;a<=n;a++){
                        for(i=1;i<=a;i++){
                            document.write(i + '*' + a + '=' + i*a + ' ') 
                        }
                        document.write('<br>')
                    }
                }
        </script>
    </body>
</html>